﻿<Page
    x:Class="OpenRPOSMetro.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:OpenRPOSMetro"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" Loaded="Page_Loaded">
    <Page.Resources>
        <Style x:Key="ListViewItemStyleOpenRPOS" TargetType="ListViewItem">
            <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
            <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="TabNavigation" Value="Local"/>
            <Setter Property="IsHoldingEnabled" Value="True"/>
            <Setter Property="Margin" Value="0,0,18,2"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListViewItem">
                        <ListViewItemPresenter SelectedBorderThickness="0" CheckHintBrush="{ThemeResource ListViewItemCheckHintThemeBrush}" CheckBrush="{ThemeResource ListViewItemCheckThemeBrush}" ContentMargin="3" ContentTransitions="{TemplateBinding ContentTransitions}" CheckSelectingBrush="{ThemeResource ListViewItemCheckSelectingThemeBrush}" DragForeground="{ThemeResource ListViewItemDragForegroundThemeBrush}" DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}" DragBackground="{ThemeResource ListViewItemDragBackgroundThemeBrush}" DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}" FocusBorderBrush="{ThemeResource ListViewItemFocusBorderThemeBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" PointerOverBackgroundMargin="1" PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}" PointerOverBackground="{ThemeResource ListViewItemPointerOverBackgroundThemeBrush}" ReorderHintOffset="{ThemeResource ListViewItemReorderHintThemeOffset}" SelectedPointerOverBorderBrush="{ThemeResource ListViewItemSelectedPointerOverBorderThemeBrush}" SelectionCheckMarkVisualEnabled="False" SelectedForeground="{ThemeResource ListViewItemSelectedForegroundThemeBrush}" SelectedPointerOverBackground="{ThemeResource ListViewItemSelectedPointerOverBackgroundThemeBrush}" SelectedBackground="{ThemeResource ListViewItemSelectedBackgroundThemeBrush}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>
    <Grid Background="#FFFFFFFF">
        <Grid.RowDefinitions>
            <RowDefinition Height="10" x:Name="rowTopMargin" />
            <RowDefinition Height="100" x:Name="rowNav" />
            <RowDefinition Height="*" x:Name="rowMenu" />
            <RowDefinition Height="100" x:Name="rowButtonBar" />
            <RowDefinition Height="30" x:Name="rowBottomMargin" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="10" x:Name="colLeftMargin" />
            <ColumnDefinition Width="410" x:Name="colOrder" />
            <ColumnDefinition Width="*" x:Name="colMenu" />
            <ColumnDefinition Width="10" x:Name="colRightMargin" />
        </Grid.ColumnDefinitions>
        <Grid x:Name="grdNav" Grid.Column="2" Grid.Row="1">
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF98DEF8" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Grid.Background>
        </Grid>
        <Grid x:Name="grdMenu" Grid.Column="2" Grid.Row="2"></Grid>
        <ComboBox x:Name="cmbOpenOrders" Grid.Column="1" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="1" VerticalAlignment="Top" Width="390" Height="56" FontSize="24" SelectionChanged="cmbOpenOrders_SelectionChanged" DropDownOpened="cmbOpenOrders_DropDownOpened" DropDownClosed="cmbOpenOrders_DropDownClosed"/>
        <ListView Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Bottom" Width="400" x:Name="lvCurrentOrderHeader" SelectionMode="Multiple" >
            <ListView.HeaderTemplate>
                <DataTemplate>
                    <Grid Margin="5,0,25,5" Background="LightGray">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="290" />
                            <ColumnDefinition Width="80" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Item" FontSize="28" Margin="5,0,0,0" />
                        <TextBlock Grid.Column="1" Margin="0,0,5,0" HorizontalAlignment="Right" Text="Price" FontSize="28" />
                    </Grid>
                </DataTemplate>
            </ListView.HeaderTemplate>
        </ListView>
        <ListView Grid.Column="1" HorizontalAlignment="Left" Margin="0" Grid.Row="2" VerticalAlignment="Top" Height="484" Width="400" x:Name="lvCurrentOrder" SelectionMode="Multiple" ItemContainerStyle="{StaticResource ListViewItemStyleOpenRPOS}" IsSwipeEnabled="False" SelectionChanged="lvCurrentOrder_SelectionChanged" >
            <ListView.ItemContainerTransitions>
                <TransitionCollection/>
            </ListView.ItemContainerTransitions>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="290" />
                            <ColumnDefinition Width="80" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Foreground="{Binding FontColor}" Grid.Column="0" Text="{Binding MenuItemName}" FontSize="28" Margin="5,0,0,0" />
                        <TextBlock Foreground="{Binding FontColor}" Grid.Column="1" Text="{Binding DisplayPrice}" FontSize="28" HorizontalAlignment="Right" />
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <TextBlock Grid.Column="1" HorizontalAlignment="Left" Margin="10,0,0,0" Grid.Row="2" TextWrapping="Wrap" Text="Subtotal" FontWeight="Bold" FontSize="28" VerticalAlignment="Bottom" />
        <TextBlock Grid.Column="1" Height="34" HorizontalAlignment="Right" Margin="0,0,35,0" Text="" Grid.Row="2" TextWrapping="Wrap" FontWeight="Bold" FontSize="28" VerticalAlignment="Bottom" x:Name="tblkTotal" />
        <TextBlock Visibility="Collapsed" Grid.Column="1" HorizontalAlignment="Left" Margin="11,10,0,0" Grid.Row="3" TextWrapping="Wrap" Text="Table" VerticalAlignment="Top" FontSize="28"/>
        <TextBox x:Name="tbTable" IsEnabled="False" Visibility="Visible" Grid.Column="1" HorizontalAlignment="Left" Margin="13,10,0,0" Grid.Row="3" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Height="40" InputScope="NumberFullWidth"  Width="149" FontSize="24" SelectionHighlightColor="#FF98DEF8" MaxLength="15" TextChanged="tbTable_TextChanged"/>
        <Button x:Name="btnFindTable" Content="Table" Grid.Column="1" HorizontalAlignment="Left" Margin="10,45,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="50" Width="155" FontSize="20" IsEnabled="True" Click="btnFindTable_Click" />
        <Button x:Name="btnCarryOut" Grid.Column="1" HorizontalAlignment="Right" Margin="0,10,125,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="True" Click="btnCarryOut_Click" >
            <Button.Content>
                <TextBlock TextWrapping="Wrap" TextAlignment="Center">Carry Out</TextBlock>
            </Button.Content>
        </Button>
        <Button x:Name="btnDelete" Content="Delete" Grid.Column="1" HorizontalAlignment="Right" Margin="0,10,10,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="False" Click="btnDelete_Click" />
        <Button Visibility="Collapsed" x:Name="btnTableUp" Grid.Column="1" HorizontalAlignment="Left" Margin="90,5,0,0" Grid.Row="3" VerticalAlignment="Top" Height="45" Width="70" Click="btnTableUp_Click">
            <Path Fill="Black" Data="M 0 6 L 12 6 L 6 0 Z" Height="25" Stretch="Fill" UseLayoutRounding="False" Width="40"/>
        </Button>
        <Button Visibility="Collapsed" x:Name="btnTableDown" Grid.Column="1" HorizontalAlignment="Left" Margin="90,50,0,0" Grid.Row="3" VerticalAlignment="Top" Height="45" Width="70" Click="btnTableDown_Click">
            <Path Fill="Black" Data="M 0 0 L 6 6 L 12 0 Z" Height="25" Stretch="Fill" UseLayoutRounding="False" Width="40"/>
        </Button>
        <Button x:Name="btnSend" Content="Send" Grid.Column="2" HorizontalAlignment="Left" Margin="10,10,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="False" Click="btnSend_Click" IsEnabledChanged="btnSend_IsEnabledChanged" />
        <Button x:Name="btnSplit" Content="Split" Grid.Column="2" HorizontalAlignment="Left" Margin="122,10,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="False" Click="btnSplit_Click" />
        <Button x:Name="btnStatus" Content="Status" Grid.Column="2" HorizontalAlignment="Left" Margin="239,10,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="True" Click="btnStatus_Click" />
        <Button x:Name="btnNew" Content="New" Grid.Column="2" HorizontalAlignment="Left" Margin="356,10,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="False" Click="btnNew_Click" />
        <Button x:Name="btnClose" Content="Close" Grid.Column="2" HorizontalAlignment="Left" Margin="473,10,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="False" Click="btnClose_Click" />
        <Button x:Name="btnPrint" Content="Print" Grid.Column="2" HorizontalAlignment="Left" Margin="590,10,0,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="20" IsEnabled="False" Click="btnPrint_Click" />
        <Button x:Name="btnManager" Content="Manager" Grid.Column="2" HorizontalAlignment="Left" Margin="707,10,0,0" BorderThickness="0" BorderBrush="Transparent" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Height="85" Width="105" FontSize="18" Click="btnManager_Click"/>
        <Button x:Name="btnLogout" Content="Logout" Grid.Column="2" HorizontalAlignment="Right" Margin="0,10,10,0" Grid.Row="3" VerticalAlignment="Top" RenderTransformOrigin="10.94,15.063" Click="btnLogout_Click" Height="85" Width="105" FontSize="20" />
        <Grid x:Name="grdStatus" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="4" Background="Green" Visibility="Collapsed">
            <TextBlock x:Name="tblkStatus" Text="" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="30" Foreground="Black"></TextBlock>
        </Grid>
    </Grid>    
</Page>
